<?php
/**
 * Created by PhpStorm.
 * User: zyark
 * Date: 2018/1/9
 * Time: 21:44
 */

namespace app\admin\validate;


use think\Validate;

class SubstitutionLog extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'reward'=>'require|regex:^[1-9]\d*(\.\d+)?$',
        'charge'=>'require|regex:^[1-9]\d*(\.\d+)?$',
        'charge_money'=>'require|regex:^[1-9]\d*(\.\d+)?$',
        'reward_money'=>'require|regex:^[1-9]\d*(\.\d+)?$',
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'reward.require'=> '扣费倍数不能为空',
        'charge.require'=> '奖励倍数不能为空',
        'charge_money.require'=> '扣费金额不能为空',
        'reward_money.require'=> '奖励金额不能为空',
        'reward.regex'=> '扣费倍数必须为大于0的数字',
        'charge.regex'=> '奖励倍数必须为大于0的数字',
        'charge_money.regex'=> '扣费金额必须为大于0的数字',
        'reward_money.regex'=> '奖励金额必须为大于0的数字',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => [],
        'edit' => [],
    ];
}